#!/usr/bin/env node

const Radio = require('./03-radio');

// 实例化 Radio 对象
const station = {
  freq: '98.7',
  name: 'Classic FM'
};

const radio = new Radio(station);

// 处理 Radio 对象的 play 事件
radio.on('play', function(station) {
  console.log(`Radio is playing on ${station.freq} - ${station.name}`);
});

// 处理 Radio 对象的 stop 事件
radio.on('stop', function(station) {
  console.log(`Radio stopped playing on ${station.freq} - ${station.name}`);
});